package top.ysez.controller;

import lombok.extern.slf4j.Slf4j;

/**
 * 创建线程的几种方式 01.继承Thread
 *
 * @author YsEz
 * @version V1.0.0
 * @date 2022/7/5 21:50
 */
@Slf4j
public class Thread01 {

  public static void main(String[] args) {
    MyThread1 myThread1 = new MyThread1();
    myThread1.start();
    MyThread2 myThread2 = new MyThread2();
    myThread2.start();
    log.info("--主线程结束");
  }

  static class MyThread1 extends Thread {
    @Override
    public void run() {
      log.info("--子线程 1");
    }
  }

  static class MyThread2 extends Thread {
    @Override
    public void run() {
      log.info("--子线程 2");
    }
  }
}
